<?
	include "../db.php";
	session_start();

	$friend1 = $_GET['friend1'];
	$friend2 = $_GET['friend2'];

	if(isset($_SESSION['username']))
	{
		$username = $_SESSION['username'];
		if($username == $friend1)
		{
			$query_cancel = "update friend set confirm = '2' where friend1_username = '$friend1' AND friend2_username = '$friend2' AND confirm = '0'";
			$result_cancel = mysql_query($query_cancel);
			if($result_cancel)
				header("location:home.php?msg=request canceled!!!");
			else	header("location:home.php?msg=problem with db");
		}
		else	header("location:../login/login.php?msg=session break...");
	}
	else	header("location:../login/login.php?msg=session break...");
?>
